/** \file Assert.cc
 * Definitions for assertion related constructs.
 *
 * (C) Copyright  Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: Assert.cc 117 2006-06-19 06:49:41Z semihc $
 *
 *
 */

#include <iostream>
#include "Assert.hpp"
#include "DBC.hpp"
#include "Debug.hh"

using namespace TC;
using namespace std;

TC_IDENT("$Id$");


int AssertionLevel::s_Val = e_ALMax;


int TC::AssertionLevel::Set(int lvl)
{
  //TODO: Mutex locking?
  int plvl = s_Val;
  s_Val = lvl;
  return plvl;
}


const AssertContext& AssertContext::print(const char* predicate, bool value) const
{
  TC_LOG_DEBUG(predicate << '=' << value);
  return *this;
}


const AssertContext& AssertContext::logContext() const
{
  TC_LOG_DEBUG("File="  << m_file <<
               " Line=" << m_line <<
               " Func=" << m_func <<
               " Desc=" << m_desc);
  return *this;
}
